#!/bin/python3
# -*- coding:utf-8 -*-
"""
    [模块名]
    By :陈狍子 e4ting@qq.com 2024-12-22 12:08:05
"""
import sys,os
from pdb import set_trace as strace
from traceback  import format_exc as dumpstack
# from e4ting import util,log

from transitions import Machine

class RoomState(object):
    pass

model = RoomState()

states = ['play', 'pause', 'stop']

actions = ['toggle', 'forward', 'backward', 'stop']

transitions = [
    {'trigger': 'forward', 'source': 'play', 'dest': 'play' },
    {'trigger': 'backward', 'source': 'play', 'dest': 'play' },
    {'trigger': 'toggle', 'source': 'play', 'dest': 'pause'},
    {'trigger': 'stop', 'source': 'play', 'dest': 'stop'},
    {'trigger': 'toggle', 'source': 'pause', 'dest': 'play'},
    {'trigger': 'forward', 'source': 'pause', 'dest': 'pause'},
    {'trigger': 'backward', 'source': 'pause', 'dest': 'pause'},
    {'trigger': 'stop', 'source': 'pause', 'dest': 'stop'},
    {'trigger': 'toggle', 'source': 'stop', 'dest': 'play'}]

machine = Machine(model=model, states=states, transitions=transitions, initial='pause')
